import request from "../../../utils/request"
import { HasImgsData, HasProductData } from "./type"

enum API {
  SKU_IMGES_URL = "/admin/product/spuImageList/",
  SKU_ATTRE_URL = "/admin/product/spuSaleAttrList/",
}

export const getSpuImgs = (spuId: number) =>
  request.get<any, HasImgsData>(API.SKU_IMGES_URL + `${spuId}`)

export const getSpuAttrs = (spuId: number) =>
  request.get<any, HasProductData>(API.SKU_ATTRE_URL + `${spuId}`)
